import request from '@/utils/request'

// 查询照片打印任务列表
export function listPrint(query) {
  return request({
    url: '/print/print/list',
    method: 'get',
    params: query
  })
}

// 查询照片打印任务详细
export function getPrint(photoTaskId) {
  return request({
    url: '/print/print/' + photoTaskId,
    method: 'get'
  })
}

// 新增照片打印任务
export function addPrint(data) {
  return request({
    url: '/print/print',
    method: 'post',
    data: data
  })
}

// 修改照片打印任务
export function updatePrint(data) {
  return request({
    url: '/print/print',
    method: 'put',
    data: data
  })
}

// 删除照片打印任务
export function delPrint(photoTaskId) {
  return request({
    url: '/print/print/' + photoTaskId,
    method: 'delete'
  })
}

// 根据任务ID获取该任务下的所有照片
export function getPhotosByTaskId(photoTaskId) {
  return request({
    url: '/print/print/' + photoTaskId + '/photos',
    method: 'get'
  })
}

// 批量添加照片到任务
export function addPhotosToTask(photoTaskId, photos) {
  return request({
    url: '/print/print/' + photoTaskId + '/photos',
    method: 'post',
    data: photos
  })
}
